package zjc.练习;

import java.util.Random;
import java.util.Scanner;

public class 验证码 {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        System.out.println("输入您需要的长度");
        int longth=sr.nextInt();
        Random sj=new Random();
        for (int i = 0; i < longth; i++) {
            int leixing=sj.nextInt(3);
            switch (leixing){
                case 0:
                    System.out.print((char)(sj.nextInt(26)+65));
                    break;
                case 1:
                    System.out.print((char)(sj.nextInt(26)+97));
                    break;
                case 2:
                    System.out.print(sj.nextInt(10));
                    break;
                default:break;
            }
        }
    }
}
